-
Notifications
You must be signed in to change notification settings - Fork 8.3k
west: runners: openocd: fix broken rtt implementation #81195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
west: runners: openocd: fix broken rtt implementation #81195
Conversation
08b259a to
c24f446
Compare
3c6597c to
0f06a1e
Compare
0f06a1e to
1ced67f
Compare
|
Some questions atm
I'll have to double-check on a different machine and modify as necessary for consistence. Still need to look at simplifying the Twister integration, but it should really be something along the lines of twister \
-i \
-p <board> \
--device-testing \
--west-flash \
--west-runner $RUNNER \
--device-serial-pty rtt \
-T samples/hello_worldKind of awkward, but the In any case, the openocd setup seems to be much more reliable than the JLink setup, although it's possible that the main problem with the JLink setup was due to #81194. |
dkalowsk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't tested these. Overall the changes match to what the commits talk about and seem logical to me. Thanks for the PR!
1ced67f to
5081f51
Compare
5081f51 to
7bbe474
Compare
7bbe474 to
8b7d3d6
Compare
|
Just to follow up here
JLink does not load the binary via the
It is run in the foreground.
It is run in the background (or rather, the TCP port is left open for gdb clients to connect). The two runners should behave quite similarly now. |
8b7d3d6 to
be3caf7
Compare
|
be3caf7 to
f143d0d
Compare
|
d045f8f to
8bf540e
Compare
|
@topisani PTAL |
|
reassigning, does not really fall under build system, or any other area that I can tell |
Add support for the rtt target so that users can run `west build -p auto -b <board> -t rtt <app>` similarly to the way that users can now do so with the debug target, since the rtt target is supposed to be used in a similar way. Signed-off-by: Chris Friedt <[email protected]>
Similar to how print_gdbserver_message() prints GDB server info when "west debug" is run, print RTT server info when "west rtt" is run. Signed-off-by: Chris Friedt <[email protected]>
Previously, there was a warning that the to_num() method can (and probably should) be unbound from OpenOcdBinaryRunner. Signed-off-by: Chris Friedt <[email protected]>
Previously, rtt start would always fail because the target (i.e. firmware) had not been started. ``` Info : rtt: Searching for control block 'SEGGER RTT' Info : rtt: No control block found ``` When the command is 'rtt', run the binary via gdb before calling 'rtt start'. Firmware calls `SEGGER_RTT_Init()` shortly after init which allows OpenOCD to find the RTT control block. Similarly, only start the 'rtt server' after calling 'rtt start' to avoid any potential race conditions internally within OpenOCD. Signed-off-by: Chris Friedt <[email protected]>
8bf540e to
a17356a
Compare
|
Looks like unrelated tests are failing - rebased (hopefully the unrelated issues are fixed already) |
|
@pdgendt - please revisit when you have a moment |
|
Sorry for the wait, LGTM |
Fixes #81156
Testing done:
Note
Due to the init strategy for the RTT buffer, either a power-cycle or reflash is required between
west rttinvocationsto observe the Hello World message again, since buffer contents and positions are preserved by default (e.g. from
mcuboot). A simple reset via gdb is not sufficient to clear the RTT buffer. Alternatively, manually erase the RTT block
via gdb memory write commands.